home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / Container / Sources / Tracker.h < prev    next >
Encoding:
Text File  |  1996-04-25  |  4.4 KB  |  163 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Tracker.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef TRACKER_H
  11. #define TRACKER_H
  12.  
  13. // ----- Part Layer -----
  14.  
  15. #ifndef FWTRACKR_H
  16. #include "FWTrackr.h"
  17. #endif
  18.  
  19. // ----- OS Layer -----
  20.  
  21. #ifndef FWRECT_H
  22. #include "FWRect.h"
  23. #endif
  24.  
  25. #ifndef FWINK_H
  26. #include "FWInk.h"
  27. #endif
  28.  
  29. #ifndef FWSTYLE_H
  30. #include "FWStyle.h"
  31. #endif
  32.  
  33. // ----- Foundation Layer -----
  34.  
  35. #ifndef FWRUNTYP_H
  36. #include "FWRunTyp.h"
  37. #endif
  38.  
  39. //========================================================================================
  40. //    Forward class declarations
  41. //========================================================================================
  42.  
  43. class CProxy;
  44. class FW_CScroller;
  45.  
  46. //========================================================================================
  47. //    class CResizeTracker
  48. //========================================================================================
  49.  
  50. class CResizeTracker : public FW_CTracker
  51. {
  52. //----------------------------------------------------------------------------------------
  53. //    Constructor/Destructor
  54. //
  55. public:
  56.     CResizeTracker(    Environment* ev, 
  57.                     FW_CView* view, ODFacet* facet,
  58.                     CProxy* theProxy, short whichHandle,
  59.                     const FW_CInk& resizeInk, const FW_CStyle& resizeStyle);
  60.     virtual ~CResizeTracker();
  61.  
  62. //----------------------------------------------------------------------------------------
  63. //    Inherited API
  64. //
  65. public:
  66.     virtual FW_CPoint     BeginTracking(Environment* ev, 
  67.                             const FW_CPoint& anchorPoint);
  68.     virtual FW_CPoint     ContinueTracking(Environment* ev, 
  69.                             const FW_CPoint& anchorPoint, 
  70.                             const FW_CPoint& previousPoint, 
  71.                             const FW_CPoint& currentPoint);
  72.     virtual FW_Boolean    EndTracking(Environment* ev, 
  73.                             const FW_CPoint& anchorPoint, 
  74.                             const FW_CPoint& lastPoint);
  75.  
  76. //----------------------------------------------------------------------------------------
  77. //    New API
  78. //
  79. public:
  80.     void        GetLastLocation(FW_CPoint& lastLocation)
  81.                     {lastLocation = fLastLocation;}
  82.     
  83. //----------------------------------------------------------------------------------------
  84. //    Data Members
  85. //
  86. private:
  87.     CProxy*            fProxy;
  88.     short            fWhichHandle;
  89.     FW_Boolean         fErase;
  90.     FW_CInk            fResizeInk;
  91.     FW_CStyle        fResizeStyle;
  92.     FW_CPoint        fDelta;
  93.     FW_CPoint        fLastLocation;
  94.     FW_CScroller*    fScroller;
  95. };
  96.  
  97. //========================================================================================
  98. //    class CTrackRect
  99. //========================================================================================
  100.  
  101. class CTrackRect
  102. {
  103.   public:
  104.     CTrackRect(const FW_CInk& frameInk, const FW_CStyle& frameStyle);
  105.     virtual ~CTrackRect();
  106.  
  107.     void TrackFeedback(Environment* ev, ODFacet* facet,  
  108.                        FW_CGraphicContext& gc,
  109.                        const FW_CPoint& anchorPoint, 
  110.                        const FW_CPoint& currentPoint, 
  111.                        FW_Boolean erase);
  112.  
  113.     void GetRectBounds(FW_CRect& bounds) const;
  114.  
  115.   private:
  116.     void SetRectGeometry(const FW_CPoint& anchorPoint, const FW_CPoint& currentPoint);
  117.  
  118.   private:
  119.     FW_CRect    fRect;
  120.     FW_CInk        fFrameInk;
  121.     FW_CStyle    fFrameStyle;
  122. };
  123.  
  124. //========================================================================================
  125. //    class CSelectTracker
  126. //========================================================================================
  127.  
  128. class CSelectTracker : public FW_CTracker
  129. {
  130. //----------------------------------------------------------------------------------------
  131. //    Constructor/Destructor
  132. //
  133.   public:
  134.     CSelectTracker(Environment* ev, 
  135.                    FW_CView* view, 
  136.                    ODFacet* facet, 
  137.                    CTrackRect* theShape);
  138.     virtual ~CSelectTracker();
  139.  
  140. //----------------------------------------------------------------------------------------
  141. //    Inherited API
  142. //
  143.   public:
  144.     virtual FW_CPoint     BeginTracking(Environment* ev, 
  145.                                     const FW_CPoint& anchorPoint);
  146.     virtual FW_CPoint     ContinueTracking(Environment* ev, 
  147.                                     const FW_CPoint& anchorPoint, 
  148.                                     const FW_CPoint& previousPoint, 
  149.                                     const FW_CPoint& currentPoint);
  150.     virtual FW_Boolean    EndTracking(Environment* ev, 
  151.                                     const FW_CPoint& anchorPoint, 
  152.                                     const FW_CPoint& lastPoint);
  153.         
  154. //----------------------------------------------------------------------------------------
  155. //    Data Members
  156. //
  157. private:
  158.     CTrackRect*     fShape;
  159.     FW_Boolean         fErase;
  160.     FW_CScroller*    fScroller;
  161. };
  162.  
  163. #endif